﻿using SqlSugar;
using System.ComponentModel.DataAnnotations;

namespace Hospital.Model.entity
{
    // 药品信息
    [SugarTable("Medicine")]
    public class Medicine : BaseId
    {
        [SugarColumn(Length = 20, IsNullable = false)]
        public string Name { get; set; } // 药品名称

        [SugarColumn(Length = 200)]
        public string Effect { get; set; } // 药效

        [SugarColumn(Length = 50, IsNullable = false)]
        public string Manufacturer { get; set; } // 生产厂家

        [SugarColumn(Length = 20, IsNullable = false)]
        public string BatchNumber { get; set; } // 生产批号

        [SugarColumn(DecimalDigits = 2, IsNullable = false)]
        public decimal UnitPrice { get; set; } // 单价

        [SugarColumn(IsNullable = false)]
        public int Stock { get; set; } // 库存

        [SugarColumn(Length = 10, IsNullable = false)]
        public string Unit { get; set; } // 单位

        [SugarColumn(IsNullable = true)]
        public DateTime? ExpiryDate { get; set; } // 新增字段：有效期
    }
}
